import java.util.*;
import java.io.*;
import java.net.*;

public class SectorRecord  implements Serializable {

    private String _date                 = null;
    private String _time                 = null;
    private String _sectorId              = null;
    private String _sectorName            = null;

    private int _totalStock            =0;
    private int _totalStockUp          =0;
    private int _totalStockDown        =0;

    private double   _totalVolume          = 0;
    private double   _totalVolumeUp        = 0;
    private double   _totalVolumeDown      = 0;

    private double   _totalMoney          = 0.0;
    private double   _totalMoneyUp        = 0.0;
    private double   _totalMoneyDown      = 0.0;

    public SectorRecord() 
    {
	this( "", "", "", "", 0, 0, 0, 0, 0, 0, 0.0, 0.0, 0.0);
    }
					
    public SectorRecord ( String date, String time, String sector_id, String sector_name,
			  int total_stock, int total_stock_up, int total_stock_down,
			  double total_volume, double total_volume_up,
			  double total_volume_down, double total_money, double total_m_up, 
			  double total_m_down)

    {
	setDate                  (date);
	setTime                  (time);
	setSectorId              (sector_id);
	setSectorName            (sector_name);

	setTotalStock            (total_stock);
	setTotalStockUp          (total_stock_up);
	setTotalStockDown        (total_stock_down);

	setTotalVolume           (total_volume);
	setTotalVolumeUp         (total_volume_up);
	setTotalVolumeDown       (total_volume_down);

	setTotalMoney            (total_money);
	setTotalMoneyUp          (total_m_up);
	setTotalMoneyDown        (total_m_down);

    }

    public void setDate       (String date)    { _date       = date;    }
    public void setTime       (String time)    { _time       = time;    }
    public void	setSectorId   (String sid)     { _sectorId   = sid;     }
    public void	setSectorName (String sname)   { _sectorName = sname;   }

    public void	setTotalStock         (int total)           { _totalStock          = total;          }
    public void	setTotalStockUp       (int total_up)        { _totalStockUp        = total_up;       }
    public void	setTotalStockDown     (int total_down)      { _totalStockDown      = total_down;     }

    public void	setTotalVolume        (double total_v)          { _totalVolume          = total_v;          }
    public void	setTotalVolumeUp      (double total_v_up)       { _totalVolumeUp        = total_v_up;       }
    public void	setTotalVolumeDown    (double total_v_down)     { _totalVolumeDown      = total_v_down;     } 
 
    public void	setTotalMoney        (double total_m)          { _totalMoney          = total_m;          }
    public void	setTotalMoneyUp      (double total_m_up)       { _totalMoneyUp        = total_m_up;       }
    public void	setTotalMoneyDown    (double total_m_down)     { _totalMoneyDown      = total_m_down;     } 
 
    public String getDate       () { return (_date       );    }
    public String getTime       () { return (_time       );    }
    public String getSectorId   () { return (_sectorId    );    }
    public String getSectorName () { return (_sectorName  );    }

    public int  getTotalStock          () { return (_totalStock          );    }
    public int  getTotalStockUp        () { return (_totalStockUp        );    }
    public int  getTotalStockDown      () { return (_totalStockDown      );    }

    public double getTotalVolume              () { return (_totalVolume          );    }
    public double getTotalVolumeUp            () { return (_totalVolumeUp        );    }
    public double getTotalVolumeDown          () { return (_totalVolumeDown      );    }

    public double getTotalMoney              () { return (_totalMoney          );    }
    public double getTotalMoneyUp            () { return (_totalMoneyUp        );    }
    public double getTotalMoneyDown          () { return (_totalMoneyDown      );    }

    public void setSectorRecord(Vector record_v) {

	Enumeration enum = record_v.elements();
	while (enum.hasMoreElements()) {
	    this.setDate((String)enum.nextElement());
	    this.setTime((String)enum.nextElement());
	    this.setSectorId((String)enum.nextElement());
	    this.setSectorName((String)enum.nextElement());

	    this.setTotalStock         (Integer.parseInt(enum.nextElement().toString()));
	    this.setTotalStockUp       (Integer.parseInt(enum.nextElement().toString()));
	    this.setTotalStockDown     (Integer.parseInt(enum.nextElement().toString()));
	    
	    this.setTotalVolume        ((Double.valueOf(enum.nextElement().toString()).doubleValue()));
	    this.setTotalVolumeUp      ((Double.valueOf(enum.nextElement().toString()).doubleValue()));
	    this.setTotalVolumeDown    ((Double.valueOf(enum.nextElement().toString()).doubleValue()));

	    this.setTotalMoney         ((Double.valueOf(enum.nextElement().toString()).doubleValue()));
	    this.setTotalMoneyUp       ((Double.valueOf(enum.nextElement().toString()).doubleValue()));
	    this.setTotalMoneyDown     ((Double.valueOf(enum.nextElement().toString()).doubleValue()));

	    break;
	}
    }

    public SectorRecord  getSectorRecord() {
	return this;
    }
}






